#pragma once
#include"public_struct.h"
int calPoints(vector<string>& ops) {
	vector<int> result;
	for (int i = 0; i < ops.size(); ++i) {
		if (ops[i] == "+") {
			result.push_back(result[result.size() - 1] + result[result.size() - 2]);
		}
		else if (ops[i] == "C") {
			result.erase(result.begin() + result.size() - 1);
		}
		else if (ops[i] == "D") {
			result.push_back(result[result.size() - 1] * 2);
		}
		else {
			result.push_back(stoi(ops[i]));
		}
	}
	int r = 0;
	for (auto i : result) {
		//cout << i << endl;
		r += i;
	}
	return r;
}